package com.leetcode.p300;

public class Test344 {

    public void reverseString(char[] s) {
        int left = 0;
        int right = s.length - 1;

        while (left < right) {
            char temp = s[left];
            s[left] = s[right];
            s[right] = temp;

            left++;
            right--;
        }
    }

    public static void main(String[] args) {
        Test344 test = new Test344();

        char[] s = new char[6];
        s[0] = 'a';
        s[1] = 'b';
        s[2] = 'c';
        s[3] = 'd';
        s[4] = 'e';
        s[5] = 'f';


        test.reverseString(s);

        System.out.println(s);
    }
}
